using UniversalAdmin.Application.Dtos.Menu;

namespace UniversalAdmin.Application.Services.Interfaces;

/// <summary>
/// 菜单服务接口
/// </summary>
public interface IMenuService
{
    /// <summary>
    /// 获取所有菜单列表
    /// </summary>
    /// <returns>菜单DTO集合</returns>
    Task<IEnumerable<MenuDto>> GetAllMenusAsync();

    /// <summary>
    /// 获取菜单树形结构
    /// </summary>
    /// <returns>菜单树形结构</returns>
    Task<IEnumerable<MenuDto>> GetMenuTreeAsync();

    /// <summary>
    /// 根据ID获取菜单详情
    /// </summary>
    /// <param name="menuId">菜单ID</param>
    /// <returns>菜单DTO或错误结果</returns>
    Task<dynamic> GetMenuByIdAsync(Guid menuId);

    /// <summary>
    /// 创建新菜单
    /// </summary>
    /// <param name="createMenuDto">菜单创建参数</param>
    /// <returns>操作结果</returns>
    Task<dynamic> CreateMenuAsync(CreateMenuDto createMenuDto);

    /// <summary>
    /// 更新菜单信息
    /// </summary>
    /// <param name="menuId">菜单ID</param>
    /// <param name="updateMenuDto">菜单更新参数</param>
    /// <returns>操作结果</returns>
    Task<dynamic> UpdateMenuAsync(Guid menuId, UpdateMenuDto updateMenuDto);

    /// <summary>
    /// 删除菜单（软删除）
    /// </summary>
    /// <param name="menuId">菜单ID</param>
    /// <returns>操作结果</returns>
    Task<dynamic> DeleteMenuAsync(Guid menuId);

    /// <summary>
    /// 启用菜单
    /// </summary>
    /// <param name="menuId">菜单ID</param>
    /// <returns>操作结果</returns>
    Task<dynamic> EnableMenuAsync(Guid menuId);

    /// <summary>
    /// 禁用菜单
    /// </summary>
    /// <param name="menuId">菜单ID</param>
    /// <returns>操作结果</returns>
    Task<dynamic> DisableMenuAsync(Guid menuId);

    /// <summary>
    /// 获取子菜单列表
    /// </summary>
    /// <param name="parentId">父级菜单ID</param>
    /// <returns>子菜单集合</returns>
    Task<IEnumerable<MenuDto>> GetChildMenusAsync(Guid parentId);

    /// <summary>
    /// 移动菜单位置
    /// </summary>
    /// <param name="menuId">菜单ID</param>
    /// <param name="newParentId">新的父级菜单ID</param>
    /// <param name="newSort">新的排序号</param>
    /// <returns>操作结果</returns>
    Task<dynamic> MoveMenuAsync(Guid menuId, Guid? newParentId, int newSort);
}
